<?php
class SiteSaveVipAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->responseType = 'json';
	}
	
	protected function afterConstruct()
	{
		$this->parseDtds('site','vip');
	}
	
	public function execute()
	{
		$data			= $this->getValidData();
		$settingService	= new SettingService();
		$skey			= 'vip_setting';
		$tmp			= $settingService->get($skey);
		if(!$tmp)
		{
			$settingService->add($skey,$data,true);
		}
		else
		{
			$settingService->update($skey,$data,false,true);
		}
		
		$this->code	= 200;
	}
}
